/**
 * 
 */
package wsdl.service;

import java.util.HashMap;

/**
 * @author Maurice & Topia
 * 
 */
public class WSDLService {

	private String name;
	private HashMap<String, WSDLPort> ports;

	public WSDLService(String name) {
		super();
		this.name = name;
		ports = new HashMap<String, WSDLPort>();
	}
	
	public HashMap<String, WSDLPort> getPorts() {
		return ports;
	}

	public void addPort(String portName, WSDLPort port) {
		ports.put(portName, port);
	}

	public String getName() {
		return name;
	}

	@Override
	public String toString() {
		String serviceStr = "service " + name + "{\n";

		for (String port : ports.keySet()) {
			serviceStr += ports.get(port).toString() + "\n";
		}

		serviceStr += "};";

		return serviceStr;
	}
}
